/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package FrameAdmin;

import Database.CreateAllTabel;
import Database.CreateCache;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
import oracle.jdbc.driver.DatabaseError;

/**
 *
 * @author WIN7
 */
public class FrameBuatTabel extends JFrame{
    private JTextArea labelText;
    private JButton buttonOk, buttonBatal;

    public FrameBuatTabel() {
        this.setTitle("Buat Tabel");
        this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        this.setBounds(500, 260, 280, 300);
        this.setResizable(false);
        this.setLayout(null);
        
        labelText = new JTextArea();
        labelText.setBounds(20, 20, 220, 190);
        labelText.setBackground(null);
        labelText.setEditable(false);
        labelText.setText("Anda akan membuat tabel : \n\n1) Tabel User Sekretariat\n\n2) Tabel User Penerima\n\n3) Tabel Surat\n\n4) Tabel Dokumen\n\n"
                + "Jika Ya pilih OK, jika tidak pilih CANCEL");
        this.add(labelText);

        buttonOk = new JButton("OK");
        buttonOk.setBounds(45, 220, 80, 30);
        this.add(buttonOk);
        buttonOk.addActionListener(new ActionListener() {
            private String[] args;

            @Override
            public void actionPerformed(ActionEvent e) {
                if(e.getSource() == buttonOk){
                    dispose();
                }
//                setVisible(false);
                CreateAllTabel.main(args);
                CreateCache.main(args);
            }
        });

        buttonBatal = new JButton("CANCEL");
        buttonBatal.setBounds(140, 220, 80, 30);
        this.add(buttonBatal);
        buttonBatal.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                setVisible(false);
            }
        });

    }
    
}
